package com.example.springboot.mapper;

import com.example.springboot.controller.request.BaseRequest;
import com.example.springboot.entity.Borrow;
import com.example.springboot.entity.ReturnBook;
import com.example.springboot.mapper.count.BorrowReturnBookCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BorrowMapper {
    List<Borrow> list();

    List<Borrow> listByCondition(BaseRequest baseRequest);

    List<BorrowReturnBookCount>getCountByTimeRange(@Param("timeRange") String timeRange, @Param("type") int type);

    void save(Borrow borrow);

    Borrow getById(Integer id);

    void update(Borrow borrow);

    void deleteById(Integer id);

    void updateStatus( @Param("status") String  status,@Param("id") Integer id);

    void saves(Borrow borrow);
}
